import http from '@/apis/http.js'

const cmsResourceApi = {
  /**
   * 查询当前用户的
   */
  readContent: (path) => {
    let data = {path: path}
    return http.doGet('/resource/readContent', data)

  },
  selectTemplates: () => {
    return http.doGet('/resource/selectTemplates', {})

  },
  /**
   * 查询列表
   * @param data
   * @returns {*|Promise<AxiosResponse<T>>}
   */
  selectList: (data) => {
    return http.doGet('/resource/selectList', data)
  },
  /**
   * 新增
   * @param data
   * @returns {*|Promise<AxiosResponse<T>>}
   */
  addService: (data) => {
    return http.doPost('/resource/add', data)
  },
  /**
   * 更新
   * @param data
   * @returns {*|Promise<AxiosResponse<T>>}
   */
  updateService: (data) => {
    return http.doPost('/resource/update', data)
  },
  /**
   * 删除
   * @param data
   * @returns {*|Promise<AxiosResponse<T>>}
   */
  deleteListService: (data) => {
    return http.doPost('/resource/delete', data)
  }
}
export default cmsResourceApi
